<div id="div" contenteditable="true">foo</div>

<script>
if (window.testRunner)
    testRunner.dumpAsText();
    
var div = document.getElementById("div");
div.focus();
document.execCommand("JustifyCenter");
document.execCommand("JustifyRight");

expected = '<div style="text-align: right;">foo</div>';
actual = div.innerHTML;

output = "This tests for a bug where centering text would prevent it from being right or left aligned again.  The paragraph should be right aligned.\n\n"

if (actual == expected)
    output += "Success";
else
    output += "Failure.  Expected: " + expected + ", found: " + actual;
    
document.body.innerText = output;
</script>
